home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / comm1 / frqmn101.lha / FRequestMan.spot
Text File  |  1996-02-05  |  7KB  |  221 lines

  1. /**************************************************************
  2. *                                                             *
  3. *                  FILEREQUESTMANAGER V 1.01                  *
  4. *                                                             * 
  5. *          SPOT-ARexx Script © 1996 by Rainer Feest           *
  6. *                                                             *
  7. *                   needs trapdoor.library                    *
  8. *                                                             *
  9. *               BUG-reports, money, ... to:                   *
  10. *             E-Mail: rf@power.rt.schwaben.de                 *
  11. *                  Fidonet : 2:246/2001.49                    *
  12. *                                                             *
  13. *                                                             *
  14. *   Description:                                              *
  15. *   -----------------------------------------------------     *
  16. *   This script helps you with your FIDO-filerequests. It     *
  17. *   automatically calls up TRAPDOOR from SPOT and gets        *
  18. *   your files.                                               *
  19. *                                                             *
  20. *   Files can be requested in three different ways:           *
  21. *   a) three defined nodes                                    *
  22. *   b) from the message-window                                *
  23. *   c) by manually entering the nodenumber                    *
  24. *                                                             *
  25. *   -----------------------------------------------------     *
  26. *   Have fun with it and send me an EMail if you like it      *
  27. *                                                             *
  28. **************************************************************/
  29.  
  30. /**************************************************************
  31. * Changes from 0.7:                                           *
  32. * - an important bug with the request-file fixed              *
  33. * - uses the Nodelist to check if selected Node exists        *
  34. * - the Systemname of the selected Node is shown in the       *
  35. *   windows                                                   *
  36. * - uses a configuration-file                                 *
  37. * - has a user-friendly setup-program                         *
  38. * - some minor bugs fixed                                     *
  39. **************************************************************/
  40.  
  41.  
  42. ADDRESS SPOT
  43. OPTIONS RESULTS
  44.  
  45. RET = ''
  46.  
  47.  
  48. prm.1="Enter your OUTBOUND directory:"
  49. def.1="OUTBOUND:"
  50. comment.1="Your outbound directory"
  51. prm.2="Enter your NODELIST directory:"
  52. def.2="NODELIST:"
  53. comment.2="The location of your nodelist"
  54. prm.3="You can now enter 3 nodenumbers of "RET"nodes you often call to request files "RET" "RET"Enter your first NODE: "
  55. def.3="1:234/567"
  56. comment.3="1st Node"
  57. prm.4="Enter your second NODE: "
  58. def.4="1:234/567"
  59. comment.4="2nd Node"
  60. prm.5="Enter your third NODE: "
  61. def.5="1:234/567"
  62. comment.5="3rd Node"
  63.  
  64.  
  65. if ~exists("Mail:frequestman.cfg") then do   
  66.   do forever
  67.     count=1
  68.     do count= 1 to 5
  69.       if count < 3 then 'requestpath TITLE "'prm.count'" PATH "'def.count'"'
  70.       else 'requeststring TITLE "FRequestMan Configuration" PROMPT "'prm.count'" DEFAULT "'def.count'" CENTER'
  71.       if RC>0 then exit
  72.       output.count = result
  73.     end
  74.     count=1
  75.     text=""
  76.     do count = 1 to 5
  77.       text=text || comment.count || ":   " || output.count || RET
  78.     end
  79.     'requestresponse TITLE "FRequestMan Configuration" PROMPT "'TEXT'" GADGETS "_Use Config|_Change|_Cancel"'
  80.     if rc = 0 then exit
  81.     if rc = 1 then do
  82.       call Open("CFG","Mail:frequestman.cfg",W)
  83.       count=1
  84.       do count = 1 to 5
  85.         call writeln("CFG", "'" || output.count || "' /* " || comment.count || " */")
  86.       end
  87.       call Close("CFG")
  88.       'requestnotify PROMPT "The configuration file is called MAIL:frequestman.cfg'RET'If you want to change something, edit this file or'RET'delete it and load the FileRequest Manager again."'
  89.       leave
  90.     end
  91.   end
  92. end
  93.  
  94.   
  95.  
  96. call Open("CFG","Mail:frequestman.cfg",R)
  97.  
  98. output = readln("CFG")
  99. parse var output "'" path "'"
  100.  
  101. output = readln("CFG")
  102. parse var output "'" nodelist "'" 
  103.  
  104. output = readln("CFG")
  105. parse var output "'" alpha "'" 
  106.  
  107. output = readln("CFG")
  108. parse var output "'" betta "'" 
  109.  
  110. output = readln("CFG")
  111. parse var output "'" gamma "'" 
  112.  
  113. call Close("CFG")
  114.  
  115.  
  116.  
  117. IF ~SHOW(Libraries,'traplist.library') THEN
  118.  IF ~ADDLIB("traplist.library",0,-30,0) THEN EXIT
  119.  
  120.  
  121. 'requestresponse TITLE "FileRequest Manger Version 1.01  © 1996 by Rainer Feest" PROMPT "Which nodenumber do you want to use?" GADGETS "'ALPHA'|'BETTA'|'GAMMA'|_Message|M_anually|_Cancel" CENTER'
  122. if rc=0 then exit
  123. if rc=1 then Node=AddinFIle(ALPHA)
  124. if rc=2 then Node=AddinFIle(BETTA)
  125. if rc=3 then Node=AddinFIle(GAMMA)
  126. if rc=4 then do
  127.   'IsIconified'
  128.    If RC=0 Then 'UnIconify'
  129.    'IsAreaList'
  130.    If RC=0 Then Do
  131.      'RequestNotify PROMPT "Do not use from arealist"'
  132.      Exit
  133.    End
  134.   'getfromaddress'
  135.   Node=AddinFile(Result)
  136. end
  137. if rc=5 then do
  138.   'requeststring TITLE "Entering other node" PROMPT "Enter Address: (e.g 1:123/456.0)" CENTER'
  139.   input=Result
  140.   call NodeName(Input,Nodelist)
  141.   Node=AddinFile(Input)
  142. end
  143.  
  144.  
  145. text = ''  
  146. input = "" 
  147. c=1  
  148.  
  149.  
  150. call exists(""Path ||Node".REQ")
  151. exist = result
  152.  
  153. if exist = 1 then do
  154.   call Open("OUT",""Path ||Node".REQ",R)
  155.   do while ~eof("OUT")
  156.     input.c = readln("OUT")
  157.     if input.c='' then leave
  158.     c=c+1
  159.   end
  160.   call Close("OUT")
  161. end
  162.  
  163.  
  164.  
  165. Do forever
  166.   'RequestString TITLE "'NodeName(FileInAdd(Node),Nodelist)'" PROMPT "File to request:"'
  167.   IF RC = 5 then leave
  168.   input.c=result || RET
  169.   c=c+1
  170. End
  171.  
  172.  
  173. do count = 1 to c-1
  174.   if input.count ~= '' then text=text || input.count
  175. end
  176.  
  177.  
  178. 'requestresponse TITLE "Files from 'NodeName(FileinAdd(Node),Nodelist)':" PROMPT "'TEXT'" GADGETS "_Get file(s)|_Delete|_Cancel" CENTER'
  179.  
  180. IF RC = 2 then do
  181.   address command
  182.     "delete >NIL: "Path ||NODE".REQ"
  183.   call Close("OUT")
  184.   exit
  185. end
  186. IF RC = 1 then do
  187.   if text="" then do
  188.     'requestnotify PROMPT "No files to request"'
  189.     exit
  190.   end
  191.   call Open("OUT",""Path ||NODE".REQ",W)
  192.   do count = 1 to c-1
  193.     Call writeln("OUT",input.count)
  194.   end
  195.   call Close("OUT")
  196.   address command 'trapdoor call' FileinAdd(Node) 'password ""'
  197. end
  198.  
  199.  
  200. exit
  201.  
  202.  
  203.  
  204. AddinFile: Procedure
  205.   parse arg ZON':'NET'/'NODE'.'
  206.   return ZON'.'NET'.'NODE'.'0
  207.  
  208. FileinAdd: Procedure
  209.   parse arg ZON'.'NET'.'NODE'.'
  210.   return ZON':'NET'/'NODE'.'0
  211.  
  212. NodeName: Procedure
  213.   parse arg Node,path
  214.   res = FindNode(Node,"All",path)
  215.   parse var res error" " "," ","sysname","
  216.   if error = 0 then do
  217.     'RequestNotify PROMPT "This node does not exist"'
  218.     exit
  219.   end
  220.   return sysname
  221.